\hypertarget{group___snake}{
\section{Snake}
\label{group___snake}\index{Snake@{Snake}}
}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structsnake}{snake}
\end{DoxyCompactItemize}
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group___snake_ga437ef08681e7210d6678427030446a54}{
\#define {\bfseries LEFT}~1}
\label{group___snake_ga437ef08681e7210d6678427030446a54}

\item 
\hypertarget{group___snake_ga80fb826a684cf3f0d306b22aa100ddac}{
\#define {\bfseries RIGHT}~2}
\label{group___snake_ga80fb826a684cf3f0d306b22aa100ddac}

\item 
\hypertarget{group___snake_ga1965eaca47dbf3f87acdafc2208f04eb}{
\#define {\bfseries UP}~3}
\label{group___snake_ga1965eaca47dbf3f87acdafc2208f04eb}

\item 
\hypertarget{group___snake_ga4193cd1c8c2e6ebd0e056fa2364a663f}{
\#define {\bfseries DOWN}~4}
\label{group___snake_ga4193cd1c8c2e6ebd0e056fa2364a663f}

\item 
\hypertarget{group___snake_ga0ec579d4bd685c0aa7cf0a143b3759fa}{
\#define {\bfseries BEND\_\-SIZE}~1000}
\label{group___snake_ga0ec579d4bd685c0aa7cf0a143b3759fa}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{group___snake_gaa1f86ea92478e973aabcf2bd795bed81}{ver\_\-erros} ()
\item 
void \hyperlink{group___snake_ga8e1a719705c9f213d4debd236aac7f41}{reset\_\-margin} ()
\item 
void \hyperlink{group___snake_gaa172410bcbf7e468f0fcb26c5ee1fb25}{initsnake} ()
\item 
void \hyperlink{group___snake_ga79bb5fa91ca6de6dc3afa1d30d3b7a38}{initscreen} ()
\item 
void \hyperlink{group___snake_ga691fa5c92fb80666093a5b130d20c7be}{gera\_\-comida} ()
\item 
void \hyperlink{group___snake_gae77cbe1f9aa2c60f5ffc8fa8fd5fc0ea}{apaga\_\-comida} ()
\item 
void \hyperlink{group___snake_ga44e45ae89e435697c7dfc0b5fc3840e1}{userinput} ()
\item 
int \hyperlink{group___snake_gab83e737f29e12bd3179a23e8bba1e513}{verifica\_\-colisao} ()
\item 
void \hyperlink{group___snake_ga835c8e217611d3e488d4398699b1d0fe}{movesnake} ()
\item 
void \hyperlink{group___snake_ga3075dc386b5ed21736b8b0ca7f4070c4}{moves} ()
\item 
int \hyperlink{group___snake_ga6ec7da6b540bc82a4f9da3dfe6a01f5a}{randomvalue} (int starting, int ending)
\item 
void \hyperlink{group___snake_ga60de64d75454385b23995437f1d72669}{start} ()
\item 
void \hyperlink{group___snake_ga6dfe1abe0d1eb3ddc1ca081de98b5342}{finish} ()
\item 
void \hyperlink{group___snake_gae9e11bd28e58e3cb5970a40f603ac198}{playsnake} ()
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group___snake_ga0134a8e0cbef63889de8504d70ff5039}{
int {\bfseries snake::length}}
\label{group___snake_ga0134a8e0cbef63889de8504d70ff5039}

\item 
\hypertarget{group___snake_ga30f45437f3d5589e6f074c9602ee4efe}{
int {\bfseries snake::head\_\-x}}
\label{group___snake_ga30f45437f3d5589e6f074c9602ee4efe}

\item 
\hypertarget{group___snake_gae5a10e3de9a3cd0d5081650cdca0561a}{
int {\bfseries snake::head\_\-y}}
\label{group___snake_gae5a10e3de9a3cd0d5081650cdca0561a}

\item 
\hypertarget{group___snake_ga698dd09de19485848753ee85a8b6264a}{
int {\bfseries snake::head\_\-dir}}
\label{group___snake_ga698dd09de19485848753ee85a8b6264a}

\item 
\hypertarget{group___snake_ga3723fd329a6d31873cbacde1319f6514}{
int {\bfseries snake::tail\_\-x}}
\label{group___snake_ga3723fd329a6d31873cbacde1319f6514}

\item 
\hypertarget{group___snake_gada5364378952025dd160580e9c895d94}{
int {\bfseries snake::tail\_\-y}}
\label{group___snake_gada5364378952025dd160580e9c895d94}

\item 
\hypertarget{group___snake_ga4746fba247378e6fc46dd39bed5e3899}{
int {\bfseries snake::tail\_\-dir}}
\label{group___snake_ga4746fba247378e6fc46dd39bed5e3899}

\item 
\hypertarget{group___snake_ga4494673b02190973cdc4bb75ed2dc9d5}{
int {\bfseries snake::bend\_\-x} \mbox{[}BEND\_\-SIZE\mbox{]}}
\label{group___snake_ga4494673b02190973cdc4bb75ed2dc9d5}

\item 
\hypertarget{group___snake_gac9498d0361905e02be2cf420246b0d79}{
int {\bfseries snake::bend\_\-y} \mbox{[}BEND\_\-SIZE\mbox{]}}
\label{group___snake_gac9498d0361905e02be2cf420246b0d79}

\item 
\hypertarget{group___snake_ga063e33be1d5397702473da15facb17a7}{
int {\bfseries snake::bend\_\-dir} \mbox{[}BEND\_\-SIZE\mbox{]}}
\label{group___snake_ga063e33be1d5397702473da15facb17a7}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Funcoes para a execucao do jogo 

\subsection{Function Documentation}
\hypertarget{group___snake_gae77cbe1f9aa2c60f5ffc8fa8fd5fc0ea}{
\index{Snake@{Snake}!apaga\_\-comida@{apaga\_\-comida}}
\index{apaga\_\-comida@{apaga\_\-comida}!Snake@{Snake}}
\subsubsection[{apaga\_\-comida}]{\setlength{\rightskip}{0pt plus 5cm}void apaga\_\-comida ()}}
\label{group___snake_gae77cbe1f9aa2c60f5ffc8fa8fd5fc0ea}
Funcao que pinta a negro a pontuacao gerada, depois de ser recolhida pela \hyperlink{structsnake}{snake} \hypertarget{group___snake_ga6dfe1abe0d1eb3ddc1ca081de98b5342}{
\index{Snake@{Snake}!finish@{finish}}
\index{finish@{finish}!Snake@{Snake}}
\subsubsection[{finish}]{\setlength{\rightskip}{0pt plus 5cm}void finish ()}}
\label{group___snake_ga6dfe1abe0d1eb3ddc1ca081de98b5342}
Funcao que lanca o menu final, depois de ocorrer GAME OVER. \hypertarget{group___snake_ga691fa5c92fb80666093a5b130d20c7be}{
\index{Snake@{Snake}!gera\_\-comida@{gera\_\-comida}}
\index{gera\_\-comida@{gera\_\-comida}!Snake@{Snake}}
\subsubsection[{gera\_\-comida}]{\setlength{\rightskip}{0pt plus 5cm}void gera\_\-comida ()}}
\label{group___snake_ga691fa5c92fb80666093a5b130d20c7be}
Funcao responsavel pela criacao dos pontos a serem recolhidos pela \hyperlink{structsnake}{snake}. Gera aleatoriamente os pontos, no ecra. \hypertarget{group___snake_ga79bb5fa91ca6de6dc3afa1d30d3b7a38}{
\index{Snake@{Snake}!initscreen@{initscreen}}
\index{initscreen@{initscreen}!Snake@{Snake}}
\subsubsection[{initscreen}]{\setlength{\rightskip}{0pt plus 5cm}void initscreen ()}}
\label{group___snake_ga79bb5fa91ca6de6dc3afa1d30d3b7a38}
Funcao responsavel pela inicializacao do ecra. Sao definidas as caracteristicas e os valores iniciais (cor de fundo, e dos caracteres) \hypertarget{group___snake_gaa172410bcbf7e468f0fcb26c5ee1fb25}{
\index{Snake@{Snake}!initsnake@{initsnake}}
\index{initsnake@{initsnake}!Snake@{Snake}}
\subsubsection[{initsnake}]{\setlength{\rightskip}{0pt plus 5cm}void initsnake ()}}
\label{group___snake_gaa172410bcbf7e468f0fcb26c5ee1fb25}
Funcao responsavel pela inicializacao da cobra (\hyperlink{structsnake}{snake}). Sao definidas as caracteristicas e os valores iniciais \hypertarget{group___snake_ga3075dc386b5ed21736b8b0ca7f4070c4}{
\index{Snake@{Snake}!moves@{moves}}
\index{moves@{moves}!Snake@{Snake}}
\subsubsection[{moves}]{\setlength{\rightskip}{0pt plus 5cm}void moves ()}}
\label{group___snake_ga3075dc386b5ed21736b8b0ca7f4070c4}
Gera movimento da cobra \hypertarget{group___snake_ga835c8e217611d3e488d4398699b1d0fe}{
\index{Snake@{Snake}!movesnake@{movesnake}}
\index{movesnake@{movesnake}!Snake@{Snake}}
\subsubsection[{movesnake}]{\setlength{\rightskip}{0pt plus 5cm}void movesnake ()}}
\label{group___snake_ga835c8e217611d3e488d4398699b1d0fe}
Funcao responsavel pela interpretacao das teclas recebidas pela funcao userinput, e pelo dirrecionamento da cabeca e da cauda, respectivamente. \hypertarget{group___snake_gae9e11bd28e58e3cb5970a40f603ac198}{
\index{Snake@{Snake}!playsnake@{playsnake}}
\index{playsnake@{playsnake}!Snake@{Snake}}
\subsubsection[{playsnake}]{\setlength{\rightskip}{0pt plus 5cm}void playsnake ()}}
\label{group___snake_gae9e11bd28e58e3cb5970a40f603ac198}
Funcao auxiliar recursiva para inicializar o jogo \hypertarget{group___snake_ga6ec7da6b540bc82a4f9da3dfe6a01f5a}{
\index{Snake@{Snake}!randomvalue@{randomvalue}}
\index{randomvalue@{randomvalue}!Snake@{Snake}}
\subsubsection[{randomvalue}]{\setlength{\rightskip}{0pt plus 5cm}int randomvalue (int {\em starting}, \/  int {\em ending})}}
\label{group___snake_ga6ec7da6b540bc82a4f9da3dfe6a01f5a}
Funcao que gera um valor aleatorio, entre dois inteiros. \hypertarget{group___snake_ga8e1a719705c9f213d4debd236aac7f41}{
\index{Snake@{Snake}!reset\_\-margin@{reset\_\-margin}}
\index{reset\_\-margin@{reset\_\-margin}!Snake@{Snake}}
\subsubsection[{reset\_\-margin}]{\setlength{\rightskip}{0pt plus 5cm}void reset\_\-margin ()}}
\label{group___snake_ga8e1a719705c9f213d4debd236aac7f41}
Funcao responsavel pela criacao da area de jogo. Sao 4 linhas paralelas. \hypertarget{group___snake_ga60de64d75454385b23995437f1d72669}{
\index{Snake@{Snake}!start@{start}}
\index{start@{start}!Snake@{Snake}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}void start ()}}
\label{group___snake_ga60de64d75454385b23995437f1d72669}
Funcao que lanca o menu de acolhimento ao jogador, bem como as instrucoes de jogo \hypertarget{group___snake_ga44e45ae89e435697c7dfc0b5fc3840e1}{
\index{Snake@{Snake}!userinput@{userinput}}
\index{userinput@{userinput}!Snake@{Snake}}
\subsubsection[{userinput}]{\setlength{\rightskip}{0pt plus 5cm}void userinput ()}}
\label{group___snake_ga44e45ae89e435697c7dfc0b5fc3840e1}
Funcao responsavel pela leitura das teclas responsaveis pelo direccioamento da \hyperlink{structsnake}{snake} recorrendo as interrupcoes do teclado. \hypertarget{group___snake_gaa1f86ea92478e973aabcf2bd795bed81}{
\index{Snake@{Snake}!ver\_\-erros@{ver\_\-erros}}
\index{ver\_\-erros@{ver\_\-erros}!Snake@{Snake}}
\subsubsection[{ver\_\-erros}]{\setlength{\rightskip}{0pt plus 5cm}void ver\_\-erros ()}}
\label{group___snake_gaa1f86ea92478e973aabcf2bd795bed81}
Funcao responsavel pelo teste de set\_\-pixel em MODO GRAFICO \hypertarget{group___snake_gab83e737f29e12bd3179a23e8bba1e513}{
\index{Snake@{Snake}!verifica\_\-colisao@{verifica\_\-colisao}}
\index{verifica\_\-colisao@{verifica\_\-colisao}!Snake@{Snake}}
\subsubsection[{verifica\_\-colisao}]{\setlength{\rightskip}{0pt plus 5cm}int verifica\_\-colisao ()}}
\label{group___snake_gab83e737f29e12bd3179a23e8bba1e513}
Funcao responsavel pela verificacao de colisao de pixeis. Caso exista colisao surge GAME OVER. 